from time import sleep
from random import randint
import board

class game:

    title = "Tic Tac Toe"

    num_of_players = 2

    def __init__(self):
        print "Creating Tic Tac To Game"
        pass 

    @property
    def players(self):
        return self.players

    @players.setter
    def players(self, players):
        self.players = players

    def start(self):
        print "Welcome to ", self.title
        print
        current_playerid = self.__get_random_playerid()
        board = board.board()

        game_status = True
        while game_status:
            current_player = current_playerid + 1
            player_move_menu = "Player ", current_player, " Please enter move: "
            player_move = input(player_move_menu)
            if board.occupy_space(current_playerid, player_move):
                current_playerid = self.__next_player(current_playerid)
                board.board.show()
            else:
                print "Try again"

    def __get_random_playerid(self):
        random_playerid = randint(0,1)
        return random_playerid

    def __next_player(self,current_playerid):
        if current_playerid == 0:
            return 1
        else:
            return 0

    def __check_board(self):
        pass
        
            

        